package com.wecan.oauth.DTO.user;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

/**
 * @Author liuzhihao
 * @Date 2022.01.20
 * @Version ${version}
 * @Description ${description}
 */
@Schema(title = "用户注册参数")
@Data
public class UserRegisterDTO {
    @Schema(title = "手机号", required = true, name = "phone")
    @NotBlank(message = "手机号不能为空")
    @Pattern(regexp = "^1(3|4|5|6|7|8|9)\\d{9}$", message = "手机号码格式不正确")
    private String phone;

    @Schema(title = "密码", required = true)
    @Size(min = 8, max = 20, message = "密码长度规则不对")
    @NotBlank(message = "密码不能为空")
    private String password;
    
    @Schema(title = "验证码", required = true)
    @NotBlank(message = "验证码不能为空")
    private String validateCode;
}
